package com.zhiche.lisa.bms.service.driver;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.zhiche.lisa.bms.dao.model.driver.FuelPriceEffective;
import com.zhiche.lisa.bms.pojo.vo.driver.FuelPriceEffectiveQueryConditionsVO;
import com.zhiche.lisa.bms.pojo.vo.driver.FuelPriceEffectiveVO;
import com.zhiche.lisa.core.supports.BaseException;
import org.springframework.validation.BindingResult;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 燃油价格生效表 服务类
 * </p>
 *
 * @author zhaoguixin
 * @since 2018-08-30
 */
public interface IFuelPriceEffectiveService extends IService<FuelPriceEffective> {

    /**
     * 分页查询
     * @param page
     * @return
     */
    Page<FuelPriceEffectiveVO> listByPage(Page<FuelPriceEffectiveVO> page);

    /**
     * 添加
     * @param fuelPriceEffectiveVO
     * @param br
     * @return
     */
    Integer add(FuelPriceEffectiveVO fuelPriceEffectiveVO, BindingResult br);

    /**
     * 更新
     * @param fuelPriceEffectiveVO
     * @param br
     * @return
     */
    Boolean update(FuelPriceEffectiveVO fuelPriceEffectiveVO, BindingResult br);

    /**
     * 删除
     * @param id
     * @return
     * @throws BaseException
     */
    Boolean del(Integer id) throws BaseException;

    /**
     * 根据条件查询
     * @param fuelPriceEffectiveQueryConditionsVO
     * @return
     */
    List<FuelPriceEffectiveVO> selectListByConditions(FuelPriceEffectiveQueryConditionsVO fuelPriceEffectiveQueryConditionsVO);

    /**
     * 根据ID查询
     * @param id
     * @return
     */
    FuelPriceEffectiveVO getById(Integer id);

    /**
     * 根据燃油类型得到最新的燃油价格
     * @param fuelTypeId
     * @param effectiveDate
     * @return
     */
    FuelPriceEffective selectByEffectiveDateAndFuelTypeId(Integer fuelTypeId, Date effectiveDate);

}
